package com.persondemo.videoappliction.ui.adapter;

import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.persondemo.videoappliction.R;
import com.persondemo.videoappliction.bean.SearchBean;
import com.persondemo.videoappliction.bean.VideoBean;
import com.persondemo.videoappliction.utils.ImageLoaderUtil;

import java.util.List;

/**
 * Created by Administrator on 2018/3/28.
 */

public class SearchAdpater extends BaseQuickAdapter<SearchBean.DataBean.BenlistBean,BaseViewHolder> {
    private Context context;
    public SearchAdpater( @Nullable List<SearchBean.DataBean.BenlistBean> data, Context context) {
        super(R.layout.item_search, data);
        this.context = context;
    }
    @Override
    protected void convert(BaseViewHolder helper, SearchBean.DataBean.BenlistBean item) {
        ImageLoaderUtil.LoadImage(context, item.getImgs(), (ImageView) helper.getView(R.id.search_img));
        helper.setText(R.id.search_title,item.getName());
        helper.setText(R.id.search_desrc,item.getContent());
    }

}
